package com.pig;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
@EnableAsync // 启用异步方法支持（用于RabbitMQ消息处理）
@EnableWebSocket // 启用WebSocket支持
public class PigMarketApplication {

    public static void main(String[] args) {
        SpringApplication.run(PigMarketApplication.class, args);
    }

    /**
     * WebSocket端点配置（在线客服功能必需）
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}